package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbChatMapper;
import com.ruoyi.system.domain.DbChat;
import com.ruoyi.system.service.IDbChatService;

/**
 * 聊天列Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-22
 */
@Service
public class DbChatServiceImpl implements IDbChatService 
{
    @Autowired
    private DbChatMapper dbChatMapper;

    /**
     * 查询聊天列
     * 
     * @param id 聊天列主键
     * @return 聊天列
     */
    @Override
    public DbChat selectDbChatById(Long id)
    {
        return dbChatMapper.selectDbChatById(id);
    }

    /**
     * 查询聊天列列表
     * 
     * @param dbChat 聊天列
     * @return 聊天列
     */
    @Override
    public List<DbChat> selectDbChatList(DbChat dbChat)
    {
        return dbChatMapper.selectDbChatList(dbChat);
    }

    /**
     * 新增聊天列
     * 
     * @param dbChat 聊天列
     * @return 结果
     */
    @Override
    public int insertDbChat(DbChat dbChat)
    {
        dbChat.setCreateTime(DateUtils.getNowDate());
        return dbChatMapper.insertDbChat(dbChat);
    }

    /**
     * 修改聊天列
     * 
     * @param dbChat 聊天列
     * @return 结果
     */
    @Override
    public int updateDbChat(DbChat dbChat)
    {
        dbChat.setUpdateTime(DateUtils.getNowDate());
        return dbChatMapper.updateDbChat(dbChat);
    }

    /**
     * 批量删除聊天列
     * 
     * @param ids 需要删除的聊天列主键
     * @return 结果
     */
    @Override
    public int deleteDbChatByIds(Long[] ids)
    {
        return dbChatMapper.deleteDbChatByIds(ids);
    }

    /**
     * 删除聊天列信息
     * 
     * @param id 聊天列主键
     * @return 结果
     */
    @Override
    public int deleteDbChatById(Long id)
    {
        return dbChatMapper.deleteDbChatById(id);
    }
}
